package listeners;

import interfaces.Controller;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;

import windows.ObjectWindow;
import windows.Window;

public class AttributeObjectButton implements ActionListener{
	private Object object;
	private JFrame window;
	private Controller controller;
	
	public AttributeObjectButton(Object object, JFrame window, Controller controller){
		this.object = object;
		this.window = window;
		this.controller = controller;
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		window.setVisible(false);
		if(controller.gotCollections(object)){
			new Window(object, window, controller);
		} else {
			new ObjectWindow(object, window, controller);
		}
	}
}

